package io;

import java.io.*;

/*
*对象流是高级流，作用是进行对象的序列化与反序列化
* 本案例演示序列化
* */
public class OosDemo {
    public static void main(String[] args) throws IOException {
        String name = "合法搜";
        int age = 12;
        String gender = "男";
        String[] otherInfo = {"帅","技术好","玩游戏好","教师"};
        Person person = new Person(name,age,gender,otherInfo);
        FileOutputStream fos = new FileOutputStream("person.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);

        oos.writeObject(person);
        System.out.println("写出完毕");
        oos.close();
    }

}
